package org.cshoo.sys.business
{
	import hessian.client.HessianService;
	
	import mx.rpc.AsyncToken;
	import mx.rpc.IResponder;
	
	import org.cshoo.common.business.ServiceLocator;
	import org.cshoo.sys.model.vo.Dictionary;
	
	public class DictionaryDelegate
	{
		public var serviceLocator:ServiceLocator = ServiceLocator.getInstance();
		
		public var _service:HessianService;
		
		private var _responder:IResponder;
		
		public function DictionaryDelegate(responder:IResponder)
		{
			_service = serviceLocator.dictionaryService;
			this._responder = responder;
		}
		
		public function findDictionaryList(dictionaryExample:Dictionary):void
		{
			var asyncToken:AsyncToken　=　_service.getOperation("findDictionaryList").send(dictionaryExample);
			asyncToken.addResponder(_responder);
		}
		
		public function findDictionaryBatcheList(firstResult:Number,maxResults:Number):void
		{
			var asyncToken:AsyncToken　=　_service.getOperation("findDictionaryBatcheList").send(firstResult,maxResults);
			asyncToken.addResponder(_responder);
		}
		
		public function findDictionaryBatcheArrayByExample(dictionaryExample:Dictionary,firstResult:Number,maxResults:Number):void
		{
			var asyncToken:AsyncToken　=　_service.getOperation("findDictionaryBatcheArrayByExample").send(dictionaryExample,firstResult,maxResults);
			asyncToken.addResponder(_responder);
		}
		
		public function addDictionary(dictionary:Dictionary):void
		{
			var asyncToken:AsyncToken = _service.getOperation("addDictionary").send(dictionary);
			asyncToken.addResponder(_responder);	
		}
		
		public function deleteDictionary(dictionary:Dictionary):void
		{
			var asyncToken:AsyncToken = _service.getOperation("deleteDictionary").send(dictionary);
			asyncToken.addResponder(_responder);
		}
		
		public function updateDictionary(dictionary:Dictionary):void
		{
			var asyncToken:AsyncToken = _service.getOperation("updateDictionary").send(dictionary);
			asyncToken.addResponder(_responder);
		}
	}
}